{extend name="Public:base"/}

{block name="main"}
<div class="box-info">
    <div class="table-toolbar">
        <a class="btn btn-primary j_btn" href="{:U('AuthManager/add')}">添加</a>
    </div>

    <form name="myform" action="{:U('AuthManager/sort')}" method="post">
        <table class="table table-hover">
            <thead>
            <tr>
                <th class="w-50px">Id</th>
                <th>节点标题</th>
                <th>节点名称</th>
                <th>图标</th>
                <th>状态</th>
                <th>菜单</th>
                <th>管理操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="r"}
            <tr>
                <td>{$r['id']}</td>
                <td>{$r['title_show']}</td>
                <td>{$r['name']}</td>
                <td><i class="{$r['icon']}"></i></td>
                <td>
                    {eq name="r.status" value="1"}
                    <a href=""><i class="fa fa-check text-success"></i></a>
                    {else/}
                    <a href="javascript:;"><i class="fa fa-ban text-danger"></i></a>
                    {/eq}
                </td>
                <td>  {eq name="r.ismenu" value="1"} <span class="text-success">是</span> {else/} <span class="text-danger">否</span> {/eq}</td>
                <td>
                    <a class="btn btn-sm btn-primary j_btn" href="{:U('AuthManager/add',array('pid'=>$r['id'],'groupid'=>$r['groupid']))}">添加子菜单</a>
                    <a class="btn btn-sm btn-info j_btn" href="{:U('AuthManager/edit',array('id' => $r['id']))}">修改</a>
                    <a class="btn btn-sm btn-danger" href="javascript:confirm_delete('{:U('AuthManager/delete',array( 'id' => $r['id']))}')">删除</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </form>
</div>

<script>
    $('.j_btn').click(function () {
        var url = $(this).attr('href');
        var title = $(this).text();
        openwin(url,title,'700px','550px');
        return false;
    });
</script>
{/block}